package com.sakura.service.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sakura.dao.LoginDao;
import com.sakura.entity.SakuraUser;
import com.sakura.service.LoginService;

@Service("loginService")
public class LoginServiceImpl implements LoginService{

	@Autowired
	private LoginDao loginDao;
	
	@Override
	public boolean authUser(String username, String password) {
		boolean b = loginDao.autoUser(username, password);
		return b;
	}

	@Override
	public void registerUser(SakuraUser sakuraUser) {
		sakuraUser.setCreateDate(new Date());
		loginDao.registerUser(sakuraUser);
	}

}
